import { get, post, put, del } from "@utils/http";

// 产品列表
export const reqProductList = (data) => post(`/product/list`, data);

// 新增产品
export const reqProductAdd = (data) => post(`/product/add`, data);

// 编辑产品
export const reqProductEdit = (data) => post(`/product/edit`, data);

// 查看产品
export const reqProductDetail = (data) => post(`/product/getDetail`, data);

// 删除产品
export const reqDeleteProduct = (data) => post(`/product/deleteProduct`, data);

/**
 * @物模型
 */

// 查看物模型
export const reqThingModelByProductKey = (data) =>
  post(`/product/getThingModelByProductKey`, data);

// 删除物模型
export const reqThingModelDel = (data) =>
  post(`/product/thingModel/delete`, data);

// 保存物模型
export const reqThingModelSave = (data) =>
  post(`/product/thingModel/save`, data);

/**
 * @型号配置
 */

// 获取产品型号
export const reqModels = (data) => post(`/product/getModelsByProductKey`, data);

// 新增
export const reqModelAdd = (data) => post(`/product/productModel/edit`, data);

// 编辑
export const reqModelEdit = (data) => post(`/product/productModel/edit`, data);

// 删除物模型
export const reqModelDel = (data) => post(`/product/productModel/delete`, data);

/**
 * @品类管理
 */

// 产品品类分页展示
export const reqCategoryList = (data) => post(`/product/category/list`, data);

// 产品品类展示
export const reqCategoryAll = (data) => post(`/product/category/getAll`, data);

// 新增
export const reqCategoryAdd = (data) => post(`/product/category/edit`, data);

// 编辑
export const reqCategoryEdit = (data) => post(`/product/category/edit`, data);

// 删除产品
export const reqCategoryDel = (data) => post(`/product/category/delete`, data);

/**
 * @设备列表
 */

// 设备列表
export const reqDevicePage = (params) => post(`/device/list`, params);

// 设备新增
export const reqDeviceAdd = (params) => post(`/device/add`, params);

// 设备编辑
export const reqDeviceSave = (params) => post(`/device/save`, params);

// 设备删除-批量
export const reqDeviceBatchDel = (params) =>
  post(`/device/batchDelete`, params);

/**
 * @指令配置
 */

// 配置列表
export const reqthingCommandList = (params) =>
  post(`/thingCommand/list`, params);

// 配置新增
export const reqThingCommandSave = (params) =>
  post(`/thingCommand/save`, params);

// 配置编辑
export const reqThingCommandEdit = (params) =>
  post(`/thingCommand/edit`, params);

// 配置删除
export const reqThingCommandDel = (id) => del(`/thingCommand/delete/${id}`);
